package com.igoal.entity;

// Generated Dec 16, 2010 11:41:39 AM by Hibernate Tools 3.3.0.GA

import static javax.persistence.GenerationType.IDENTITY;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.compass.annotations.SearchableProperty;

/**
 * Banner generated by hbm2java
 */
@Entity
@Table(name = "banner")
public class Banner extends BaseObject implements Audit {
	private static final long serialVersionUID = 1L;
	
	private Long id;
	private String type;
	private String name;
	private String alias;
	private int imptotal;
	private int impmade;
	private int clicks;
	private String imageurl;
	private String clickurl;
	private Date date;
	private boolean showBanner;
	private boolean checkedOut;
	private Date checkedOutTime;
	private String editor;
	private String custombannercode;
	private String description;
	private boolean sticky;
	private int ordering;
	private Date publishUp;
	private Date publishDown;
	private String tags;
	private String params;
	private Date cdate;
	private Date mdate;
	private DataStatus status;
	
	private BannerCategory bannerCategory;
	private BannerClient bannerClient;

	public Banner() {
	}

	public Banner(long bannerClientId, String type, String name, String alias,
			int imptotal, int impmade, int clicks, String imageurl,
			String clickurl, boolean showBanner, boolean checkedOut,
			Date checkedOutTime, long bannerCategoryId, String description,
			boolean sticky, int ordering, Date publishUp, Date publishDown,
			String tags, String params, Date cdate, Date mdate, DataStatus status) {

		this.type = type;
		this.name = name;
		this.alias = alias;
		this.imptotal = imptotal;
		this.impmade = impmade;
		this.clicks = clicks;
		this.imageurl = imageurl;
		this.clickurl = clickurl;
		this.showBanner = showBanner;
		this.checkedOut = checkedOut;
		this.checkedOutTime = checkedOutTime;
		this.description = description;
		this.sticky = sticky;
		this.ordering = ordering;
		this.publishUp = publishUp;
		this.publishDown = publishDown;
		this.tags = tags;
		this.params = params;
		this.cdate = cdate;
		this.mdate = mdate;
		this.status = status;
	}

	public Banner(long bannerClientId, String type, String name, String alias,
			int imptotal, int impmade, int clicks, String imageurl,
			String clickurl, Date date, boolean showBanner, boolean checkedOut,
			Date checkedOutTime, String editor, String custombannercode,
			long bannerCategoryId, String description, boolean sticky,
			int ordering, Date publishUp, Date publishDown, String tags,
			String params, Date cdate, Date mdate, DataStatus status) {

		this.type = type;
		this.name = name;
		this.alias = alias;
		this.imptotal = imptotal;
		this.impmade = impmade;
		this.clicks = clicks;
		this.imageurl = imageurl;
		this.clickurl = clickurl;
		this.date = date;
		this.showBanner = showBanner;
		this.checkedOut = checkedOut;
		this.checkedOutTime = checkedOutTime;
		this.editor = editor;
		this.custombannercode = custombannercode;
		this.description = description;
		this.sticky = sticky;
		this.ordering = ordering;
		this.publishUp = publishUp;
		this.publishDown = publishDown;
		this.tags = tags;
		this.params = params;
		this.cdate = cdate;
		this.mdate = mdate;
		this.status = status;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@Column(name = "type", nullable = false, length = 30)
	public String getType() {
		return this.type;
	}

	public void setType(String type) {
		this.type = type;
	}

	@Column(name = "name", nullable = false)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "alias", nullable = false)
	public String getAlias() {
		return this.alias;
	}

	public void setAlias(String alias) {
		this.alias = alias;
	}

	@Column(name = "imptotal", nullable = false)
	public int getImptotal() {
		return this.imptotal;
	}

	public void setImptotal(int imptotal) {
		this.imptotal = imptotal;
	}

	@Column(name = "impmade", nullable = false)
	public int getImpmade() {
		return this.impmade;
	}

	public void setImpmade(int impmade) {
		this.impmade = impmade;
	}

	@Column(name = "clicks", nullable = false)
	public int getClicks() {
		return this.clicks;
	}

	public void setClicks(int clicks) {
		this.clicks = clicks;
	}

	@Column(name = "imageurl", nullable = false, length = 100)
	public String getImageurl() {
		return this.imageurl;
	}

	public void setImageurl(String imageurl) {
		this.imageurl = imageurl;
	}

	@Column(name = "clickurl", nullable = false, length = 200)
	public String getClickurl() {
		return this.clickurl;
	}

	public void setClickurl(String clickurl) {
		this.clickurl = clickurl;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "date", length = 19)
	public Date getDate() {
		return this.date;
	}

	public void setDate(Date date) {
		this.date = date;
	}

	@Column(name = "showBanner", nullable = false)
	public boolean isShowBanner() {
		return this.showBanner;
	}

	public void setShowBanner(boolean showBanner) {
		this.showBanner = showBanner;
	}

	@Column(name = "checked_out", nullable = false)
	public boolean isCheckedOut() {
		return this.checkedOut;
	}

	public void setCheckedOut(boolean checkedOut) {
		this.checkedOut = checkedOut;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "checked_out_time", nullable = false, length = 19)
	public Date getCheckedOutTime() {
		return this.checkedOutTime;
	}

	public void setCheckedOutTime(Date checkedOutTime) {
		this.checkedOutTime = checkedOutTime;
	}

	@Column(name = "editor", length = 50)
	public String getEditor() {
		return this.editor;
	}

	public void setEditor(String editor) {
		this.editor = editor;
	}

	@Column(name = "custombannercode", length = 65535)
	public String getCustombannercode() {
		return this.custombannercode;
	}

	public void setCustombannercode(String custombannercode) {
		this.custombannercode = custombannercode;
	}

	@Column(name = "description", nullable = false, length = 65535)
	public String getDescription() {
		return this.description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	@Column(name = "sticky", nullable = false)
	public boolean isSticky() {
		return this.sticky;
	}

	public void setSticky(boolean sticky) {
		this.sticky = sticky;
	}

	@Column(name = "ordering", nullable = false)
	public int getOrdering() {
		return this.ordering;
	}

	public void setOrdering(int ordering) {
		this.ordering = ordering;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "publish_up", nullable = false, length = 19)
	public Date getPublishUp() {
		return this.publishUp;
	}

	public void setPublishUp(Date publishUp) {
		this.publishUp = publishUp;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "publish_down", nullable = false, length = 19)
	public Date getPublishDown() {
		return this.publishDown;
	}

	public void setPublishDown(Date publishDown) {
		this.publishDown = publishDown;
	}

	@Column(name = "tags", nullable = false, length = 65535)
	public String getTags() {
		return this.tags;
	}

	public void setTags(String tags) {
		this.tags = tags;
	}

	@Column(name = "params", nullable = false, length = 65535)
	public String getParams() {
		return this.params;
	}

	public void setParams(String params) {
		this.params = params;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "cdate", nullable = false, length = 19)
	public Date getCreateDate() {
		return this.cdate;
	}

	public void setCreateDate(Date cdate) {
		this.cdate = cdate;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "mdate", nullable = false, length = 19)
	public Date getUpdateDate() {
		return this.mdate;
	}

	public void setUpdateDate(Date mdate) {
		this.mdate = mdate;
	}

	@Override
	public boolean equals(Object o) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public int hashCode() {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public String toString() {
		// TODO Auto-generated method stub
		return null;
	}

	public void setStatus(DataStatus dataStatus) {
		this.status = dataStatus;
	}
	
	@Enumerated(EnumType.STRING)
	@Column(nullable=false, name="status")
	@SearchableProperty
	public DataStatus getStatus(){
		return status;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "banner_client_id", nullable = false)
	public BannerClient getBannerClient() {
		return this.bannerClient;
	}

	public void setBannerClient(BannerClient bannerClient) {
		this.bannerClient = bannerClient;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "banner_category_id", nullable = false)
	public BannerCategory getBannerCategory() {
		return this.bannerCategory;
	}

	public void setBannerCategory(BannerCategory bannerCategory) {
		this.bannerCategory = bannerCategory;
	}

}
